﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="AirplaneReservation.Default" %>
<%@ Register src="WUC_DropDownListCalendar.ascx" tagname="WUC_DropDownListCalendar" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style14
        {
            width: 183px;
        }
        .style15
        {
        }
        .style16
        {
            width: 128px;
        }
    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderLeft" runat="server">

    
    <table style="width:100%;">
    <tr><td align="center">
                                <asp:RadioButton ID="one" runat="server" 
            GroupName="trip" Text="One Way" AutoPostBack="True" 
            oncheckedchanged="one_CheckedChanged" />
                                <asp:RadioButton ID="round" runat="server" GroupName="trip" 
                                    Text="Round Trip" AutoPostBack="True" 
            oncheckedchanged="round_CheckedChanged" />
                            </td></tr>
        <tr>
            <td>

    
   

    
                <asp:Panel ID="Panel1" runat="server">
                    <table cellpadding="3px" cellspacing="3px" 
    style="width:100%;">
                        <tr>
                            <td align="right" class="style15" valign="middle">
                                From</td>
                            <td class="style14" valign="middle">
                                <asp:DropDownList ID="From" runat="server" Height="16px" 
                Width="143px" AutoPostBack="True" DataSourceID="SqlDataSource4" DataTextField="Name" 
                                    DataValueField="Id">
                                </asp:DropDownList>
                                &nbsp;</td>
                            <td align="left" valign="middle">
                                To&nbsp;
                                <asp:DropDownList ID="to" runat="server" Height="16px" 
                Width="153px" AutoPostBack="True" DataSourceID="SqlDataSource4" DataTextField="Name" 
                                    DataValueField="Id">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style15" valign="top">
                                Depart. Date</td>
                            <td class="style14" valign="middle">
                                <uc1:WUC_DropDownListCalendar ID="departDate" runat="server" />
                            </td>
                            <td align="center" valign="middle">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td align="right" class="style15" valign="top">
                                Class</td>
                            <td class="style14" valign="middle">
                                <asp:DropDownList ID="drlClass" runat="server" DataSourceID="SqlDataSource5" 
                                    DataTextField="Name" DataValueField="Id">
                                    <asp:ListItem>Business class</asp:ListItem>
                                    <asp:ListItem>First class</asp:ListItem>
                                    <asp:ListItem>Club class</asp:ListItem>
                                    <asp:ListItem>Smoking</asp:ListItem>
                                    <asp:ListItem>Non-Smoking</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td align="center" valign="middle">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td align="right" class="style15" valign="middle">
                                Adult</td>
                            <td class="style14" valign="middle">
                                <asp:DropDownList ID="adult" runat="server" Height="16px" 
                Width="42px">
                                    <asp:ListItem>0</asp:ListItem>
                                    <asp:ListItem>1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                    <asp:ListItem>3</asp:ListItem>
                                    <asp:ListItem>4</asp:ListItem>
                                    <asp:ListItem>5</asp:ListItem>
                                    <asp:ListItem>6</asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Children&nbsp;
                                <asp:DropDownList ID="children" runat="server" 
                Height="17px" Width="38px">
                                    <asp:ListItem>0</asp:ListItem>
                                    <asp:ListItem>1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                    <asp:ListItem>3</asp:ListItem>
                                    <asp:ListItem>4</asp:ListItem>
                                    <asp:ListItem>5</asp:ListItem>
                                    <asp:ListItem>6</asp:ListItem>
                                    <asp:ListItem></asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;
                            </td>
                            <td align="left" valign="middle">
                                Senior Citizen&nbsp;
                                <asp:DropDownList ID="senior" runat="server" 
                Height="17px" Width="38px">
                                    <asp:ListItem>0</asp:ListItem>
                                    <asp:ListItem>1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                    <asp:ListItem>3</asp:ListItem>
                                    <asp:ListItem>4</asp:ListItem>
                                    <asp:ListItem>5</asp:ListItem>
                                    <asp:ListItem>6</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style15" valign="middle">
                                &nbsp;</td>
                            <td class="style14" valign="middle">
                                <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:airplaneConnectionString %>" 
                                    SelectCommand="SELECT [Id], [Name] FROM [Location]"></asp:SqlDataSource>
                                <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:airplaneConnectionString %>" 
                                    SelectCommand="SELECT * FROM [Class]"></asp:SqlDataSource>
                            </td>
                            <td align="center" valign="middle">
                                <asp:Button ID="search" runat="server" Font-Bold="True" 
                Text="Find Flight" CausesValidation="False" onclick="search_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td align="center" class="style15" colspan="3" valign="middle">
                                <asp:Label ID="Label4" runat="server" ForeColor="Red"></asp:Label>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>

    
   

    
            </td>
        </tr>
        <tr>
            <td>
                <asp:Panel ID="Panel2" runat="server" Visible="False">
                    <table cellpadding="3px" cellspacing="3px" 
    style="width:100%;">
                        <tr>
                            <td align="right" class="style15" valign="middle">
                                From</td>
                            <td class="style14" valign="middle">
                                <asp:DropDownList ID="From0" runat="server" Height="16px" 
                Width="143px" AutoPostBack="True" DataSourceID="SqlDataSource4" DataTextField="Name" 
                                    DataValueField="Id">
                                </asp:DropDownList>
                                &nbsp;</td>
                            <td align="center" valign="middle">
                                To&nbsp;
                                <asp:DropDownList ID="to0" runat="server" Height="16px" 
                Width="153px" AutoPostBack="True" DataSourceID="SqlDataSource4" DataTextField="Name" 
                                    DataValueField="Id">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style15" valign="top">
                                Depart. Date</td>
                            <td class="style14" valign="middle">
                                <uc1:WUC_DropDownListCalendar ID="WUC_DropDownListCalendar2" runat="server" />
                            </td>
                            <td align="center" valign="middle">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td align="right" class="style15" valign="top">
                                <asp:Label ID="Label3" runat="server" Text="Return"></asp:Label>
                            </td>
                            <td class="style14" valign="middle">
                                <uc1:WUC_DropDownListCalendar ID="WUC_DropDownListCalendar1" runat="server" />
                            </td>
                            <td align="center" valign="middle">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td align="right" class="style15" valign="top">
                                Class</td>
                            <td class="style14" valign="middle">
                                <asp:DropDownList ID="drlClass0" runat="server" DataSourceID="SqlDataSource5" 
                                    DataTextField="Name" DataValueField="Id">
                                    <asp:ListItem>Business class</asp:ListItem>
                                    <asp:ListItem>First class</asp:ListItem>
                                    <asp:ListItem>Club class</asp:ListItem>
                                    <asp:ListItem>Smoking</asp:ListItem>
                                    <asp:ListItem>Non-Smoking</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td align="center" valign="middle">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td align="right" class="style15" valign="middle">
                                Adult</td>
                            <td class="style14" valign="middle">
                                <asp:DropDownList ID="adult0" runat="server" Height="16px" Width="42px">
                                    <asp:ListItem>0</asp:ListItem>
                                    <asp:ListItem>1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                    <asp:ListItem>3</asp:ListItem>
                                    <asp:ListItem>4</asp:ListItem>
                                    <asp:ListItem>5</asp:ListItem>
                                    <asp:ListItem>6</asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Children&nbsp;
                                <asp:DropDownList ID="children0" runat="server" Height="17px" Width="38px">
                                    <asp:ListItem>0</asp:ListItem>
                                    <asp:ListItem>1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                    <asp:ListItem>3</asp:ListItem>
                                    <asp:ListItem>4</asp:ListItem>
                                    <asp:ListItem>5</asp:ListItem>
                                    <asp:ListItem>6</asp:ListItem>
                                    <asp:ListItem></asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;
                            </td>
                            <td align="left" valign="middle">
                                Senior Citizen&nbsp;
                                <asp:DropDownList ID="senior0" runat="server" Height="17px" Width="38px">
                                    <asp:ListItem>0</asp:ListItem>
                                    <asp:ListItem>1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                    <asp:ListItem>3</asp:ListItem>
                                    <asp:ListItem>4</asp:ListItem>
                                    <asp:ListItem>5</asp:ListItem>
                                    <asp:ListItem>6</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style15" valign="middle">
                                &nbsp;</td>
                            <td class="style14" valign="middle">
                                &nbsp;</td>
                            <td align="center" valign="middle">
                                <asp:Button ID="btnSearch" runat="server" CausesValidation="False" 
                                    Font-Bold="True" onclick="btnSearch_Click" Text="Find Flight" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
        <tr>            <td align="center">
            <asp:GridView ID="GridView1" runat="server" AutoGenerateSelectButton="True" 
                CellPadding="0" CellSpacing="1" ForeColor="#333333" GridLines="None" 
                onselectedindexchanged="GridView1_SelectedIndexChanged" 
                onrowcreated="GridView1_RowCreated">
                <AlternatingRowStyle BackColor="White" />
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" ForeColor="Black" Font-Size="Smaller" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>
            </td> </tr>

        <tr>            <td>
            <asp:Panel ID="Panel3" runat="server" Visible="False">
                <table style="width:100%;">
                    <tr>
                        <td align="right" class="style16">
                            Total Price</td>
                        <td>
                            <asp:TextBox ID="toTal" runat="server" Height="20px" ReadOnly="True" 
                                Width="105px"></asp:TextBox>
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td align="right" class="style16">
                            Refund</td>
                        <td>
                            <asp:TextBox ID="TextBox1" runat="server" Height="102px" ReadOnly="True" 
                                TextMode="MultiLine" Width="265px"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td class="style16">
                            &nbsp;</td>
                        <td align="center">
                        <% if (Session["ssRole"] == "member")
                           {%>
                            <asp:Button ID="block" runat="server" CausesValidation="False" Font-Bold="True" 
                                onclick="block_Click" Text="Block" />
                            &nbsp;<asp:Button ID="buy" runat="server" CausesValidation="False" Font-Bold="True" 
                                Text="Buy" onclick="buy_Click" />
                                <%} %>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                </table>
            </asp:Panel>
            </td> </tr>

        <tr>            <td align="center">
            <asp:Label ID="Label5" runat="server" Font-Bold="True" Font-Size="Medium" 
                ForeColor="Red"></asp:Label>
            </td> </tr>

        </table>

    
</asp:Content>
